//注册通知信息
function add_Data() {
    var formData = new FormData($("#informAddForm")[0]);
    var inform_title = $("#inform_title").val();
    var inform_content = $("#inform_content").val();
    formData.append("inform_title_1", inform_title);
    formData.append("inform_content_1", inform_content);
    $.ajax({
        url: "insertInformByInformData",
        type: 'POST',
        data: formData,
        cache: false,
        async: false,
        processData: false,  //必须false才会避开jQuery对 formdata 的默认处理
        contentType: false,  //必须false才会自动加上正确的Content-Type
        success: function (data) {
            if (data.code == 200) {
                Swal.fire("提示", "数据登记成功!", "success");
                $.getJSON("hcontroller/addmiddletable", {uid: uid, hid: hid}, function (json) {
                    console.log(json);
                });
            } else if (data.code == 300) {
                Swal.fire("提示", "请提交相应材料!", "warning");
            } else {
                Swal.fire("提示", "登记数据有误!", "error");
            }
        },
        error: function (data) {
            if (data.code == 500) {
                Swal.fire("提示", "数据提交失败!", "error");
            }
        }
    });

    var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
    parent.layer.close(index); //执行关闭
    parent.location.href = "/yihuan/Background-InformList.html";//回到父级页面
}

//查询回收品类型信息

$("#add_Data").click(function () {
    add_Data();
});
